package com.Servlet;

import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class Connection {

	public Context ctx;
	public Connection() throws NamingException {
		Properties props = new Properties();

		props.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");

		props.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");

		props.setProperty("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");

		// optional. Defaults to localhost. Only needed if web server is
		// running
		// on a different host than the appserver
		props.setProperty("org.omg.CORBA.ORBInitialHost", "127.0.0.1");

		// optional. Defaults to 3700. Only needed if target orb port is not
		// 3700.
		props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");

		ctx = new InitialContext(props);
	}
}
